Fix case-insensitive extension lookup in CygwinCCompiler._make_out_path#5223
Open
armorbreak001 wants to merge 1 commit intopypa:mainfrom
Open
Fix case-insensitive extension lookup in CygwinCCompiler._make_out_path#5223armorbreak001 wants to merge 1 commit intopypa:mainfrom
armorbreak001 wants to merge 1 commit intopypa:mainfrom
Conversation
os.path.normcase was applied to the source filename but not to the extension lookup keys in out_extensions. This caused uppercase extensions like '.S' (assembly) to fail with an 'unknown file type' error when added to src_extensions, since normcase lowercased the suffix to '.s' which had no matching key. Apply normcase to both the source name and the extension keys so that any casing of '.rc', '.S', etc. is handled correctly. Closes pypa#5130
Contributor
|
Hi @armorbreak001 , thank you for the contribution. Usually changes in the Setuptools simply merge the upstream repo back into the |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
os.path.normcasewas applied to the source filename but not to theextension lookup keys in
out_extensions. On Cygwin/Windows,normcaselowercases the filename, so a source file like
foo.Swould have itssuffix lowercased to
.s. If.swas not a key inout_extensions(e.g. only
.Swas added viasrc_extensions.append(".S")), thisraised
UnknownFileType: unknown file type '.s'.Fix
Apply
os.path.normcaseto both the source name and the extensiondictionary keys so that any casing of
.rc,.S,.c, etc. is handledcorrectly regardless of how the extension was registered.
This preserves the original intent of the
normcasecall (handling.RC→.rcfor resource files) while also fixing uppercase extensionslike
.Sfor assembly files.Closes #5130